#pragma once
#include "DJoint.h"

namespace Skill
{
	namespace Ode
	{
		ref class DWorld;
		ref class DVector3;
		namespace Joints
		{
			ref class DJointGroup;
			public ref class DSlider : DJoint
			{
			protected:
				virtual void CollectManagedMemory() override;
			public:

				///<summary>
				/// Create a new joint of the slider type.
				///</summary>
				///<param name = "world"> Wrold </param>
				///<param name = "group">
				/// set to null to allocate the joint normally.
				/// If it is valid the joint is allocated in the given joint group.
				///</param>				
				DSlider(DWorld^ world , DJointGroup^ group);



				///<summary>
				/// Gets or set the joint axis
				///</summary>
				REF_PROP_DECLARATION_GETSET(DVector3,Axis);

				
				void SetAxisDelta(dReal x, dReal y, dReal z, dReal ax, dReal ay, dReal az);
				void SetAxisDelta(DVector3^ p, DVector3^ d);

				///<summary>
				/// set joint parameter
				///</summary>
				void SetParam(DJointParameters parameter, dReal value);	

				///<summary>
				/// Get joint parameter
				///</summary>
				dReal GetParam(DJointParameters parameter);

				///<summary>
				/// Applies the given force in the slider's direction.
				///
				/// That is, it applies a force with specified magnitude, in the direction of
				/// slider's axis, to body1, and with the same magnitude but opposite
				/// direction to body2.  This function is just a wrapper for dBodyAddForce().
				///</summary>
				void AddForce(dReal force);

				///<summary>
				/// Get the slider linear position (i.e. the slider's extension)
				///
				/// When the axis is set, the current position of the attached bodies is
				/// examined and that position will be the zero position.

				/// The position is the distance, with respect to the zero position,
				/// along the slider axis of body 1 with respect to
				/// body 2. (A NULL body is replaced by the world).
				///</summary>				
				VALUE_PROP_DECLARATION_GET(dReal,Position);

				///<summary>
				/// Get the slider linear position's time derivative.				
				///</summary>				
				VALUE_PROP_DECLARATION_GET(dReal,PositionRate);				
			};
		}
	}
}